Skip to content

Reject null for enum values - #1212

Merged
Frotty merged 1 commit into
masterfrom
fix-enum-nullability
Jul 31, 2026
Merged

Reject null for enum values#1212
Frotty merged 1 commit into
masterfrom
fix-enum-nullability

Conversation

@Frotty

@Frotty Frotty commented Jul 31, 2026

Copy link
Copy Markdown
Member

Enums lower to integers, so nullable enums let null compare equal to the first member. Mark enums non-nullable and cover assignment, comparison, and default-value behavior.

Tests:

  • ./gradlew.bat test --tests tests.wurstscript.tests.EnumTests
  • ./gradlew.bat test --tests tests.wurstscript.tests.SimpleFunctionTests --tests tests.wurstscript.tests.SimpleStatementTests

@Frotty
Frotty marked this pull request as ready for review July 31, 2026 16:33
@Frotty
Frotty merged commit 06c5991 into master Jul 31, 2026
6 checks passed
@Frotty
Frotty deleted the fix-enum-nullability branch July 31, 2026 16:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant